// ***************************************************************************************
// Copyright (c) 2023-2025 Peng Cheng Laboratory
// Copyright (c) 2023-2025 Institute of Computing Technology, Chinese Academy of Sciences
// Copyright (c) 2023-2025 Beijing Institute of Open Source Chip
//
// iEDA is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
//
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
//
// See the Mulan PSL v2 for more details.
// ***************************************************************************************
/*
 * @Author: S.J Chen
 * @Date: 2022-03-09 21:31:13
 * @LastEditTime: 2022-03-10 16:00:42
 * @LastEditors: S.J Chen
 * @Description:
 * @FilePath: /iEDA/src/iPL/src/operator/global_placer/NesterovPlace/database/NesPin.hh
 * Contact : https://github.com/sjchanson
 */

#include <string>
#include <vector>

#include "contest_row.h" 
#include "Point.hh"
namespace ieda_contest {
class ContestLayout
{
 public:
  ContestLayout() = default;
  ContestLayout(std::string name);
  ContestLayout(const ContestLayout&) = delete;
  ContestLayout(ContestLayout&&) = delete;
  ~ContestLayout()= default;

  ContestLayout& operator=(const ContestLayout&) = delete;
  ContestLayout& operator=(ContestLayout&&) = delete;

  // getter.
  std::string get_design_name() const { return _design_name; }
  int32_t get_database_unit() const { return _database_unit; }
  Point<int32_t> get_die_lower_point() const { return _die_lower_point; }
  Point<int32_t> get_die_upper_point() const { return _die_upper_point; }
  Point<int32_t> get_core_lower_point() const { return _core_lower_point; }
  Point<int32_t> get_core_upper_point() const { return _core_upper_point; }
  int32_t get_row_height() const { return _row_height; }
  int32_t get_site_width() const { return _site_width; }
  std::vector<std::vector<ContestRow*>>& get_row_2d_list() { return _row_2d_list;}


  // setter.
  void set_database_unit(int32_t int32_t) { _database_unit = int32_t; }
  void set_die_lower_point(Point<int32_t> point) { _die_lower_point = point; }
  void set_die_upper_point(Point<int32_t> point) { _die_upper_point = point; }
  void set_core_lower_point(Point<int32_t> point) { _core_lower_point = point; }
  void set_core_upper_point(Point<int32_t> point) { _core_upper_point = point; }
  void set_row_height(int32_t height) { _row_height = height; }
  void set_site_width(int32_t width) { _site_width = width; }
  void set_row_2d_list(std::vector<std::vector<ContestRow*>> row_2d_list) {_row_2d_list = std::move(row_2d_list);}

 private:
  std::string _design_name;
  int32_t _database_unit;
  Point<int32_t> _die_lower_point;
  Point<int32_t> _die_upper_point;
  Point<int32_t> _core_lower_point;
  Point<int32_t> _core_upper_point;
  std::vector<std::vector<ContestRow*>> _row_2d_list;

  int32_t _row_height;
  int32_t _site_width;
};
inline  ContestLayout::ContestLayout(std::string name):_design_name(name){}



}  // namespace ipl

